﻿<Window x:Class="RPNcalc.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ぎゃくポでんたく" Height="431" Width="525">
    <DockPanel Background="LightGray">
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="ファイル(_F)">
                <MenuItem Header="辞書をよむ(_L)" Click="Load_Click"/>
                <MenuItem Header="辞書にかく(_S)" Click="Save_Click"/>
                <MenuItem Header="おしまい(_X)" Click="Exit_Click" />
            </MenuItem>
        </Menu>
        <StatusBar DockPanel.Dock="Bottom">
            <Label Content="{Binding Path=Status}"/>
        </StatusBar>
             <Grid DockPanel.Dock="top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Label Content="こたえ" Grid.Column="0" Grid.Row="0"  HorizontalAlignment="Center" VerticalAlignment="Bottom" />
            <GridSplitter Grid.Column="1" Grid.RowSpan="2" ResizeDirection="Columns" Height="Auto" Width="10" VerticalAlignment="Stretch" ResizeBehavior="PreviousAndNext" IsTabStop="False"/>
            <Label Content="あたまんなか" Grid.Column="2" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
            <TextBox Name="StackTop" Grid.Column="0" Grid.Row="1" Text="{Binding Path=StackTop, Mode=OneWay}" AcceptsReturn="False" FontSize="64" Margin="5" MinWidth="200" IsReadOnly="True" IsTabStop="False"/>
            <ListBox Name="Stack" Grid.Column="2" Grid.Row="1" ItemsSource="{Binding Path=Stack}" Height="{Binding ElementName=StackTop, Path=Height}" Margin="5" FontSize="16" />
        </Grid>
        <DockPanel DockPanel.Dock="Right">
            <StackPanel DockPanel.Dock="top" Margin="5">
                <ComboBox Name="Delay" Width="60" SelectedIndex="0">
                    <ComboBoxItem>
                        <Image Stretch="None" Source="/RPNcalc;component/Icon/turtle.ico" />
                    </ComboBoxItem>
                    <ComboBoxItem>
                        <Image Stretch="None" Source="/RPNcalc;component/Icon/car.ico" />
                    </ComboBoxItem>
                    <ComboBoxItem>
                        <Image Stretch="None" Source="/RPNcalc;component/Icon/rocket.ico" />
                    </ComboBoxItem>
                </ComboBox>
            </StackPanel>
            <StackPanel DockPanel.Dock="Bottom" Margin="5">
                <Button Name="Exec" Click="Exec_Click" Height="56">
                    <Image Source="/RPNcalc;component/Icon/app.ico" Stretch="None" Margin="5"/>
                </Button>
            </StackPanel>
            <StackPanel Margin="5">
                <Button Name="Edit" Click="Edit_Click">
                    <Image Source="/RPNcalc;component/Icon/pen.ico" Stretch="None" />
                </Button>
            </StackPanel>
        </DockPanel>
        <Grid DockPanel.Dock="Bottom">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBox Name="Word" Text="{Binding Path=Word}" Grid.Column="0" FontSize="32" Margin="5"/>
            <GridSplitter Grid.Column="1" Width="10" ResizeDirection="Columns" ResizeBehavior="PreviousAndNext" IsTabStop="False"/>
            <TextBox Name="Command" Text="{Binding Path=Command}" Grid.Column="2" FontSize="32" Margin="5"/>
        </Grid>
        <ListView Name="Dictionary" ItemsSource="{Binding Path=Dictionary}" Margin="5" SelectedItem="{Binding Path=SelectedItem,Mode=OneWayToSource}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="なまえ" DisplayMemberBinding="{Binding Path=Key}" Width="100"/>
                    <GridViewColumn Header="なかみ" DisplayMemberBinding="{Binding Path=Value}" Width="300"/>
                </GridView>
            </ListView.View>
        </ListView>
    </DockPanel>
</Window>
